package com.gaocf.designpatterns.behavior.observable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gaocf
 * 观察者设计模式
 */
public class LogNotify {
    List<Log> logs = new ArrayList<>();

    public void AddLogType(Log log) {
        logs.add(log);
    }

    public void WriteLog(String content) {
        logs.stream().forEach(log -> {
            log.writeLog(content);
        });
    }
}
